<div>
    <a class="layui-btn" href="{:url('addson')}">添加</a>
</div>

<table class="layui-table edit-table" lay-data="{cellMinWidth: 80,
    url:'{:url('getlist')}',page: true}" lay-filter="edit-table" data-url="{:url('editPermissions')}" data-key="permission_id">
    <thead>
    <tr>
        <th lay-data="{field:'son_id', width:40, sort: true}">ID</th>
        <th lay-data="{field:'son_name', edit:'number', sort: true}">子账号名称</th>
        <th lay-data="{toolbar:'#son_type',sort: true}">子账号类型</th>
        <th lay-data="{field:'area_name'}">地区</th>
        <th lay-data="{field:'fee'}">剩余金额</th>
        <th lay-data="{toolbar:'#order',sort: true}">订单数量</th>
        <th lay-data="{field:'day',sort: true}">当日数量</th>
        <th lay-data="{toolbar:'#status'}">状态</th>
        <th lay-data="{toolbar: '#manipulate',minWidth:200, fixed: 'right'}">操作</th>
    </tr>
    </thead>
</table>
<script type="text/html" id="order">
    <a href="{:url('order')}?id={{d.son_id}}" class="layui-btn layui-btn-sm layui-btn-normal">{{d.order_count}}</a>
</script>
<script type="text/html" id="son_type">
    {{# if (d.type==1) { }}
    <span class="layui-btn layui-btn-sm">平台子账户</span>
    {{# } else if (d.type==2) { }}
    <span class="layui-btn layui-btn-sm layui-btn-danger">第三方账户</span>
    {{# } }}
</script>
<script type="text/html" id="status">
    {{# if (d.status==1) { }}
    <span class="layui-btn layui-btn-sm">正常</span>
    {{# } else if (d.status==2) { }}
    <span class="layui-btn layui-btn-sm layui-btn-danger">关闭</span>
    {{# } }}
</script>

<script type="text/html" id="manipulate">


    {{# if (d.status==2) { }}
    <a href="{:url('changestatus')}?id={{d.son_id}}" class="layui-btn ajax-delete layui-btn-sm" data-msg="确定开启？">开启</a>
    {{# } else if (d.status==1) { }}
    <a href="{:url('jieshu')}?id={{d.son_id}}" class="layui-btn ajax-delete layui-btn-sm layui-btn-danger" data-msg="确定结束？">关闭</a>
    {{# } }}

    <a href="{:url('hdelete')}?id={{d.son_id}}" class="layui-btn ajax-delete layui-btn-sm layui-btn-danger" data-msg="确定删除？">删除</a>

    <a href="{:url('chongzhi')}?id={{d.son_id}}" class="layui-btn layui-btn-sm">充值</a>
</script>